/****** Object:  Table CHI_TIET_GIO_HANG    Script Date: 12/06/2009 21:04:08 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
DROP TABLE CHI_TIET_GIO_HANG
GO
CREATE TABLE CHI_TIET_GIO_HANG(
	id smallint NOT NULL,
	idSanPham smallint NOT NULL,
	idHinhAnh smallint NOT NULL,
	SoLuong smallint NOT NULL,
	TongTien bigint NOT NULL,
	idGioHang smallint NOT NULL,
	NgayCapNhat datetime NOT NULL,
	NgayLapGio datetime NOT NULL,
	NgayThanhToan datetime NOT NULL,
 CONSTRAINT PK_CHI_TIET_GIO_HANG PRIMARY KEY CLUSTERED 
(
	id ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
INSERT INTO CHI_TIET_GIO_HANG (id, idSanPham, idHinhAnh, SoLuong, TongTien, idGioHang, NgayCapNhat, NgayLapGio, NgayThanhToan) VALUES (1, 1, 1, 1, 100000, 1, CAST(0x00009CC700000000 AS DateTime), CAST(0x00009CC200000000 AS DateTime), CAST(0x00009CC700000000 AS DateTime))
INSERT INTO CHI_TIET_GIO_HANG (id, idSanPham, idHinhAnh, SoLuong, TongTien, idGioHang, NgayCapNhat, NgayLapGio, NgayThanhToan) VALUES (2, 2, 2, 1, 100000, 2, CAST(0x00009CC700000000 AS DateTime), CAST(0x00009CBF00000000 AS DateTime), CAST(0x00009CC700000000 AS DateTime))
INSERT INTO CHI_TIET_GIO_HANG (id, idSanPham, idHinhAnh, SoLuong, TongTien, idGioHang, NgayCapNhat, NgayLapGio, NgayThanhToan) VALUES (3, 3, 3, 2, 100000, 2, CAST(0x00009CC700000000 AS DateTime), CAST(0x00009CC100000000 AS DateTime), CAST(0x00009CC700000000 AS DateTime))
INSERT INTO CHI_TIET_GIO_HANG (id, idSanPham, idHinhAnh, SoLuong, TongTien, idGioHang, NgayCapNhat, NgayLapGio, NgayThanhToan) VALUES (4, 5, 5, 4, 100000, 2, CAST(0x00009CC700000000 AS DateTime), CAST(0x00009CC000000000 AS DateTime), CAST(0x00009CC700000000 AS DateTime))
INSERT INTO CHI_TIET_GIO_HANG (id, idSanPham, idHinhAnh, SoLuong, TongTien, idGioHang, NgayCapNhat, NgayLapGio, NgayThanhToan) VALUES (5, 3, 3, 1, 100000, 3, CAST(0x00009CC700000000 AS DateTime), CAST(0x00009CC200000000 AS DateTime), CAST(0x00009CC700000000 AS DateTime))
INSERT INTO CHI_TIET_GIO_HANG (id, idSanPham, idHinhAnh, SoLuong, TongTien, idGioHang, NgayCapNhat, NgayLapGio, NgayThanhToan) VALUES (6, 4, 4, 1, 100000, 4, CAST(0x00009CC700000000 AS DateTime), CAST(0x00009CC000000000 AS DateTime), CAST(0x00009CC700000000 AS DateTime))
INSERT INTO CHI_TIET_GIO_HANG (id, idSanPham, idHinhAnh, SoLuong, TongTien, idGioHang, NgayCapNhat, NgayLapGio, NgayThanhToan) VALUES (7, 5, 5, 1, 100000, 5, CAST(0x00009CC700000000 AS DateTime), CAST(0x00009CC200000000 AS DateTime), CAST(0x00009CC700000000 AS DateTime))
INSERT INTO CHI_TIET_GIO_HANG (id, idSanPham, idHinhAnh, SoLuong, TongTien, idGioHang, NgayCapNhat, NgayLapGio, NgayThanhToan) VALUES (8, 6, 6, 1, 100000, 6, CAST(0x00009CC700000000 AS DateTime), CAST(0x00009CC300000000 AS DateTime), CAST(0x00009CC700000000 AS DateTime))
INSERT INTO CHI_TIET_GIO_HANG (id, idSanPham, idHinhAnh, SoLuong, TongTien, idGioHang, NgayCapNhat, NgayLapGio, NgayThanhToan) VALUES (9, 7, 7, 2, 100000, 7, CAST(0x00009CC700000000 AS DateTime), CAST(0x00009CBF00000000 AS DateTime), CAST(0x00009CC700000000 AS DateTime))
INSERT INTO CHI_TIET_GIO_HANG (id, idSanPham, idHinhAnh, SoLuong, TongTien, idGioHang, NgayCapNhat, NgayLapGio, NgayThanhToan) VALUES (10, 12, 12, 3, 100000, 7, CAST(0x00009CC700000000 AS DateTime), CAST(0x00009CC200000000 AS DateTime), CAST(0x00009CC700000000 AS DateTime))
INSERT INTO CHI_TIET_GIO_HANG (id, idSanPham, idHinhAnh, SoLuong, TongTien, idGioHang, NgayCapNhat, NgayLapGio, NgayThanhToan) VALUES (11, 13, 13, 4, 100000, 7, CAST(0x00009CC700000000 AS DateTime), CAST(0x00009CC300000000 AS DateTime), CAST(0x00009CC700000000 AS DateTime))
INSERT INTO CHI_TIET_GIO_HANG (id, idSanPham, idHinhAnh, SoLuong, TongTien, idGioHang, NgayCapNhat, NgayLapGio, NgayThanhToan) VALUES (12, 8, 8, 1, 100000, 8, CAST(0x00009CC700000000 AS DateTime), CAST(0x00009CC400000000 AS DateTime), CAST(0x00009CC700000000 AS DateTime))
INSERT INTO CHI_TIET_GIO_HANG (id, idSanPham, idHinhAnh, SoLuong, TongTien, idGioHang, NgayCapNhat, NgayLapGio, NgayThanhToan) VALUES (13, 9, 9, 1, 100000, 9, CAST(0x00009CC700000000 AS DateTime), CAST(0x00009CC500000000 AS DateTime), CAST(0x00009CC700000000 AS DateTime))
INSERT INTO CHI_TIET_GIO_HANG (id, idSanPham, idHinhAnh, SoLuong, TongTien, idGioHang, NgayCapNhat, NgayLapGio, NgayThanhToan) VALUES (14, 10, 10, 1, 100000, 10, CAST(0x00009CC700000000 AS DateTime), CAST(0x00009CC700000000 AS DateTime), CAST(0x00009CC700000000 AS DateTime))

/****** Object:  ForeignKey [FK_CHI_TIET_GIO_HANG_GIO_HANG]    Script Date: 12/06/2009 21:04:08 ******/
ALTER TABLE [dbo].[CHI_TIET_GIO_HANG]  WITH CHECK ADD  CONSTRAINT [FK_CHI_TIET_GIO_HANG_GIO_HANG] FOREIGN KEY([idGioHang])
REFERENCES [dbo].[GIO_HANG] ([id])
GO
ALTER TABLE [dbo].[CHI_TIET_GIO_HANG] CHECK CONSTRAINT [FK_CHI_TIET_GIO_HANG_GIO_HANG]
GO
/****** Object:  ForeignKey [FK_CHI_TIET_GIO_HANG_SAN_PHAM]    Script Date: 12/06/2009 21:04:08 ******/
ALTER TABLE [dbo].[CHI_TIET_GIO_HANG]  WITH CHECK ADD  CONSTRAINT [FK_CHI_TIET_GIO_HANG_SAN_PHAM] FOREIGN KEY([idSanPham])
REFERENCES [dbo].[SAN_PHAM] ([id])
GO
ALTER TABLE [dbo].[CHI_TIET_GIO_HANG] CHECK CONSTRAINT [FK_CHI_TIET_GIO_HANG_SAN_PHAM]
GO
/****** Object:  ForeignKey [FK_CHI_TIET_GIO_HANG_HINH_ANH]    Script Date: 12/06/2009 21:04:08 ******/
ALTER TABLE [dbo].[CHI_TIET_GIO_HANG]  WITH CHECK ADD  CONSTRAINT FK_CHI_TIET_GIO_HANG_HINH_ANH FOREIGN KEY(idHinhAnh)
REFERENCES [dbo].[HINH_ANH] ([id])
GO
ALTER TABLE [dbo].[CHI_TIET_GIO_HANG] CHECK CONSTRAINT [FK_CHI_TIET_GIO_HANG_HINH_ANH]
GO